Esri Geoportal Server
1.0

com.esri.gpt.server.assertion.components
Class AsnProperty

java.lang.Object
  extended by com.esri.gpt.server.assertion.components.AsnProperty
Direct Known Subclasses:
AsnUIResource

public class AsnProperty
extends Object

A tree structure or properties with subject, predicate and value.


Constructor Summary
AsnProperty()
          Default constructor
AsnProperty(AsnProperty objectToDuplicate)
          Construct by duplicating an existing object.
AsnProperty(String subject, String predicate, String value)
          Constructs with a subject, predicate and value.
 
Method Summary
 String asJson()
          Returns a JSON representation of the property.
 String asXml()
          Returns an XML representation of the property.
 AsnProperty duplicate()
          Produces a deep clone of the object.
 AsnProperties ensureChildren()
          Gets the child properties (ensures that the collection has been instantiated).
 AsnProperties getChildren()
          Gets the child properties.
 String getPredicate()
          Gets the predicate.
 boolean getQuoteJsonValue()
          Gets the flag indicating whether or not the JSON value should be quoted.
 String getSubject()
          Gets the subject.
 String getValue()
          Gets the value.
 boolean hasChildren()
          Determines whether or not this property has children.
 void setChildren(AsnProperties children)
          Sets the child properties.
 void setPredicate(String predicate)
          Sets the predicate.
 void setQuoteJsonValue(boolean quote)
          Sets the flag indicating whether or not the JSON value should be quoted.
 void setSubject(String subject)
          Sets the subject.
 void setValue(String value)
          Sets the value.
 void toJson(PrintWriter writer, int depth, boolean isLast)
          Writes a JSON representation of the property.
 void toXml(PrintWriter writer, int depth)
          Writes an XML representation of the property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsnProperty

public AsnProperty()
Default constructor


AsnProperty

public AsnProperty(String subject,
                   String predicate,
                   String value)
Constructs with a subject, predicate and value.

Parameters:
subject - the subject
predicate - the predicate
value - the value

AsnProperty

public AsnProperty(AsnProperty objectToDuplicate)
Construct by duplicating an existing object.

Parameters:
objectToDuplicate - the object to duplicate
Method Detail

getChildren

public AsnProperties getChildren()
Gets the child properties.

Returns:
the child properties

setChildren

public void setChildren(AsnProperties children)
Sets the child properties.

Parameters:
children - the child properties

getPredicate

public String getPredicate()
Gets the predicate.

Returns:
the predicate

setPredicate

public void setPredicate(String predicate)
Sets the predicate.

Parameters:
predicate - the predicate

getQuoteJsonValue

public boolean getQuoteJsonValue()
Gets the flag indicating whether or not the JSON value should be quoted.

Returns:
true if quoted (i.e. a Javascript string)

setQuoteJsonValue

public void setQuoteJsonValue(boolean quote)
Sets the flag indicating whether or not the JSON value should be quoted.

Parameters:
quote - true if quoted (i.e. a Javascript string)

getSubject

public String getSubject()
Gets the subject.

Returns:
the subject

setSubject

public void setSubject(String subject)
Sets the subject.

Parameters:
subject - the subject

getValue

public String getValue()
Gets the value.

Returns:
the value

setValue

public void setValue(String value)
Sets the value.

Parameters:
value - the value

asJson

public String asJson()
              throws IOException
Returns a JSON representation of the property.

Returns:
the JSON string
Throws:
IOException - if an exception occurs

asXml

public String asXml()
             throws IOException
Returns an XML representation of the property.

Returns:
the XML string
Throws:
IOException - if an exception occurs

duplicate

public AsnProperty duplicate()
Produces a deep clone of the object.
The duplication constructor is invoked.
return new AsnProperty(this);

Returns:
the duplicated object

ensureChildren

public AsnProperties ensureChildren()
Gets the child properties (ensures that the collection has been instantiated).

Returns:
the child properties

hasChildren

public boolean hasChildren()
Determines whether or not this property has children.

Returns:
true if this property has children

toJson

public void toJson(PrintWriter writer,
                   int depth,
                   boolean isLast)
            throws IOException
Writes a JSON representation of the property.

Parameters:
writer - the writer
depth - the depth of the parent
Throws:
IOException - if an exception occurs

toXml

public void toXml(PrintWriter writer,
                  int depth)
           throws IOException
Writes an XML representation of the property.

Parameters:
writer - the writer
depth - the depth of the parent
Throws:
IOException - if an exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.