mirror of
https://github.com/hapifhir/hapi-fhir.git
synced 2025-02-18 02:45:07 +00:00
More Atom
This commit is contained in:
parent
bec9a51351
commit
45c9186dee
@ -55,15 +55,13 @@ class ParserState<T extends IElement> {
|
|||||||
public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException {
|
public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException {
|
||||||
if ("name".equals(theLocalPart)) {
|
if ("name".equals(theLocalPart)) {
|
||||||
push(new AtomPrimitiveState(myInstance.getAuthorName()));
|
push(new AtomPrimitiveState(myInstance.getAuthorName()));
|
||||||
}else if ("uri".equals(theLocalPart)) {
|
} else if ("uri".equals(theLocalPart)) {
|
||||||
push(new AtomPrimitiveState(myInstance.getAuthorUri()));
|
push(new AtomPrimitiveState(myInstance.getAuthorUri()));
|
||||||
}else {
|
} else {
|
||||||
throw new DataFormatException("Unexpected element: " + theLocalPart);
|
throw new DataFormatException("Unexpected element: " + theLocalPart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ParserState.class);
|
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ParserState.class);
|
||||||
@ -131,7 +129,6 @@ class ParserState<T extends IElement> {
|
|||||||
myPrimitive = thePrimitive;
|
myPrimitive = thePrimitive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void endingElement(EndElement theElem) throws DataFormatException {
|
public void endingElement(EndElement theElem) throws DataFormatException {
|
||||||
myPrimitive.setValueAsString(myData);
|
myPrimitive.setValueAsString(myData);
|
||||||
@ -204,10 +201,8 @@ class ParserState<T extends IElement> {
|
|||||||
throw new DataFormatException("Found unexpected element content");
|
throw new DataFormatException("Found unexpected element content");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static final QName ATOM_LINK_REL_ATTRIBUTE = new QName("rel");
|
private static final QName ATOM_LINK_REL_ATTRIBUTE = new QName("rel");
|
||||||
private static final QName ATOM_LINK_HREF_ATTRIBUTE = new QName("href");
|
private static final QName ATOM_LINK_HREF_ATTRIBUTE = new QName("href");
|
||||||
|
|
||||||
@ -232,7 +227,9 @@ class ParserState<T extends IElement> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException {
|
public void enteringNewElement(String theNamespaceURI, String theLocalPart) throws DataFormatException {
|
||||||
if (theLocalPart.equals("title")) {
|
if ("entry".equals(theLocalPart) && verifyNamespace(XmlParser.ATOM_NS, theNamespaceURI)) {
|
||||||
|
|
||||||
|
} else if (theLocalPart.equals("title")) {
|
||||||
push(new AtomPrimitiveState(myInstance.getTitle()));
|
push(new AtomPrimitiveState(myInstance.getTitle()));
|
||||||
} else if ("id".equals(theLocalPart)) {
|
} else if ("id".equals(theLocalPart)) {
|
||||||
push(new AtomPrimitiveState(myInstance.getId()));
|
push(new AtomPrimitiveState(myInstance.getId()));
|
||||||
@ -244,8 +241,8 @@ class ParserState<T extends IElement> {
|
|||||||
push(new AtomPrimitiveState(myInstance.getUpdated()));
|
push(new AtomPrimitiveState(myInstance.getUpdated()));
|
||||||
} else if ("author".equals(theLocalPart)) {
|
} else if ("author".equals(theLocalPart)) {
|
||||||
push(new AtomAuthorState(myInstance));
|
push(new AtomAuthorState(myInstance));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: handle category and DSig
|
// TODO: handle category and DSig
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user